<!--src/main/resources/templates/article/add.html-->
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>新增文章</title>
    <link rel="stylesheet" type="text/css" th:href="@{/css/addstyles.css}">
</head>
<body>
<h2>新增文章</h2>
<form th:action="@{/article/add}" th:object="${article}" method="post">
    <label>文章编号:</label>
    <input type="text" th:field="*{id}" readonly="readonly"/><br/>

    <label>文章标题:</label>
    <input type="text" th:field="*{title}" required/><br/>

    <label>文章内容:</label>
    <textarea th:field="*{content}" required></textarea><br/>

    <label>发布时间:</label>
    <input type="text" th:field="*{pubDate}" readonly="readonly"/><br/>

    <label>用户编号:</label>
    <input type="text" th:field="*{userId}" required/><br/>
    <label>用户名:</label>
    <input type="text" th:field="*{username}" required/><br/>

    <label>文章类型编号:</label>
    <input type="text" th:field="*{articleTypeId}" required/><br/>

    <button type="submit">发布</button>
    <a th:href="@{/article/findAll}" class="cancel-btn">取消</a>
</form>
</body>
</html>
